import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '序号',
    align:"center",
    sorter: true,
    dataIndex: 'no'
   },
   {
    title: '项目ID',
    align:"center",
    dataIndex: 'projectId'
   },
   {
    title: '项目名称',
    align:"center",
    dataIndex: 'projectName'
   },
   {
    title: '财评日期',
    align:"center",
    dataIndex: 'evalDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '财评文号',
    align:"center",
    dataIndex: 'approvalNum'
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'status'
   },
   {
    title: '流程ID',
    align:"center",
    dataIndex: 'procInsId'
   },
   {
    title: 'evalType',
    align:"center",
    dataIndex: 'evalType'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "序号",
      field: 'no',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "项目名称",
      field: 'projectName',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "状态",
      field: 'status',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '序号',
    field: 'no',
    component: 'Input',
  },
  {
    label: '项目ID',
    field: 'projectId',
    component: 'Input',
  },
  {
    label: '项目名称',
    field: 'projectName',
    component: 'Input',
  },
  {
    label: '财评日期',
    field: 'evalDate',
    component: 'DatePicker',
  },
  {
    label: '财评文号',
    field: 'approvalNum',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'status',
    component: 'Input',
  },
  {
    label: '流程ID',
    field: 'procInsId',
    component: 'Input',
  },
  {
    label: 'evalType',
    field: 'evalType',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  no: {title: '序号',order: 0,view: 'text', type: 'string',},
  projectId: {title: '项目ID',order: 1,view: 'text', type: 'string',},
  projectName: {title: '项目名称',order: 2,view: 'text', type: 'string',},
  evalDate: {title: '财评日期',order: 3,view: 'date', type: 'string',},
  approvalNum: {title: '财评文号',order: 4,view: 'text', type: 'string',},
  status: {title: '状态',order: 5,view: 'text', type: 'string',},
  procInsId: {title: '流程ID',order: 6,view: 'text', type: 'string',},
  evalType: {title: 'evalType',order: 7,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}